﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        int i = 1;
        public Form1()
        {
            InitializeComponent();
            
        }

        private void ChangeLanguage(string lang)
        {
 
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btnOpform_Click(object sender, EventArgs e)
        {
            new Form2().Show();
            
        }

        private void btnChicon_Click(object sender, EventArgs e)
        {
            this.Icon = (Properties.Resources.ICON1);
            
            
        }

        private void btnRsticon_Click(object sender, EventArgs e)
        {
            this.Icon = default(System.Drawing.Icon);

        }

        private void btnLanguage_Click(object sender, EventArgs e)
        {


            if (i % 2 == 0)
            {
                
                ChangeLanguage("en");
                i--;
            }
            else 
            {
                ChangeLanguage("sv-SE");
                i++;
            }







        }

        private void btnCall_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];


        }

        

    }
}
